package com.quickask.dao;

import com.quickask.entity.AsknowUserAttentionEntity;
import com.quickask.idao.IUserAttentionDao;

import java.util.List;

/**
 * Created by Administrator on 2015/9/30.
 */
public class UserAttentionDao extends BaseDao<AsknowUserAttentionEntity, Integer> implements IUserAttentionDao {

    /**
     * 关注用户
     *
     * @param asknowUserAttentionEntity 实体
     */
    @Override
    public void addAttentionUser(AsknowUserAttentionEntity asknowUserAttentionEntity) {
        save(asknowUserAttentionEntity);
    }

    /**
     * 获取用户关注列表
     *
     * @param userId 用户id
     * @return
     */
    @Override
    public List<AsknowUserAttentionEntity> getUserAttentionEntityList(int userId) {
        return getListByHQL("from AsknowUserAttentionEntity as auae where auae.userId = ?", userId);
    }
}
